package com.meizitu.entity;

import java.util.*;

/**
 * 链接集合
 *
 * @author zhouinfo
 * @Create Date 2016-08-02 1:30
 */
public class LinkSet {

    private Set<String> visitedURL = new HashSet<String>();

    private Queue<String> unVisitURL = new LinkedList<String>();

    public void addVisitedURL(String url) {
        visitedURL.add(url);
    }

    public void removeVisitedURL(String url) {
        visitedURL.remove(url);
    }

    public int getVisitedURLSize() {
        return visitedURL.size();
    }

    public Queue<String> getUnVisit() {
        return unVisitURL;
    }

    public void addUnVisitURL(String url) {
        if (url != null && url != "" && !visitedURL.contains(url) && !unVisitURL.contains(url)) {
            unVisitURL.add(url);
        }
    }

    public String getUnVisitURL() {
        return unVisitURL.remove();
    }

    public boolean isEmptyUnVisitURL() {
        return unVisitURL.isEmpty();
    }
}
